package main

import "fmt"

func MakeMap() {
	//申明变量的形式创建
	var m map[string]string = map[string]string{"水果": "苹果", "手机": "iPhone"}
	m["电脑"] = "Mac"
	//make创建
	m2 := make(map[string]string)
	m2["法国"] = "巴黎"
	m2["日本"] = "东京"
	m2["美国"] = "华盛顿"
	for country := range m {
		fmt.Println(country, m[country])
	}
	for country := range m2 {
		fmt.Println(country, m2[country])
	}
}
func DeleteMap() {
	m2 := make(map[string]string)
	m2["法国"] = "巴黎"
	m2["日本"] = "东京"
	m2["美国"] = "华盛顿"
	delete(m2, "法国")
	for country := range m2 {
		fmt.Println(country, m2[country])
	}
}
